//该文件专门用于创建整个应用的路由器
import VueRouter from "vue-router";
//引入组件
import About from "@/pages/About";
import Home from "@/pages/Home";
import HomeNews from "@/pages/HomeNews";
import HomeMessage from "@/pages/HomeMessage";
import Detail from "@/pages/Detail";

//创建并暴露一个路由器
export default new VueRouter({
    routes:[
        {
            name:'guanyu',
            path:'/about',
            component:About
        },
        {
            path:'/home',
            component:Home,
            children:[
                {
                    path:'news',
                    component:HomeNews
                },
                {
                    path:'message',
                    component:HomeMessage,
                    children:[
                        {
                            name:'xiangqing',
                            path:'detail/:id/:title',  //nodejs的占位符，后面会填充内容
                            component:Detail
                        }
                    ]
                }
            ]
        }
    ]
})
